package cool.taomu.demo

import java.io.ByteArrayInputStream
import java.io.File
import java.io.FileOutputStream
import org.apache.commons.io.IOUtils
import org.jsoup.Connection.Method
import org.jsoup.Jsoup

class SaveData {
	def static void main(String[] args) {
		var String url = "https://q.stock.sohu.com/hisHq?code=cn_601377,cn_000686&start=20000101&end=20230131";

		var connect = Jsoup.connect(url);
		var respone = connect.maxBodySize(50000000).method(Method.GET).ignoreContentType(true).execute();
		var bytes = respone.bodyAsBytes;
		IOUtils.copy(new ByteArrayInputStream(bytes), new FileOutputStream(new File("./data.json")));
	}
	/**
	 * 解析数据
	 */
	def void jx(){
		//日期，开盘，收盘，涨跌，涨幅，最低，最高，成交量，成交额，换手。
	}
}
